<?php

namespace App\Models;


class ShopGoodsSkuModel
{
    /**
     * 查询商品sku
     * entry $sku_id
     * return array
     * */
    public static function getGoodsSkuInfo($conn,$sku_id){
        $Sql="SELECT `sku_id`,`sku_name`,`sku_code`, `goods_id`,`sku_img_id`,`sku_stock`,`sku_cost_price`,`sku_old_price`,`sku_old_price`,`sku_sell_price`,`sku_old_price`,`sku_game_points`,`quota_number`,`is_delete`,`create_time`,`update_time`,`delete_time` FROM `shop_goods_sku` where `sku_id` =$sku_id";
        return $conn->readConn($Sql);
    }
    /**
     * 修改
     * entry $Example
     * return int
     * */
    public static function upshopGoodsSkuInside($conn,$Example){
        $joinSql="";
        if($Example->sku_stock !=null){
            $joinSql.=" `sku_stock` = '$Example->sku_stock',";
        }
        if($joinSql !=null){
            $innerJoin = rtrim($joinSql,",");
            $upUserSql="UPDATE  `shop_goods_sku` SET $innerJoin WHERE `sku_id` = '$Example->sku_id'";
            return $conn->executeConn($upUserSql);
        }
    }
}